package com.woniuxy.his.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.his.entity.Doctor;
import com.woniuxy.his.mapper.DoctorMapper;
import com.woniuxy.his.service.IDoctorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 医生表 服务实现类
 * </p>
 *
 * @author Lucas
 * @since 2021-08-25
 */
@Service
@Slf4j
public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> implements IDoctorService {

    @Resource
    private DoctorMapper doctorMapper;
    @Override
    public IPage<Doctor> findDoctorsByArrangeTime(String arrangeTime, Integer current, Integer size) {
        log.info("查询时间为{}",arrangeTime);
        IPage page=new Page(current,size);

        IPage doctorsByArrangeTime = doctorMapper.findDoctorsByArrangeTime(page, arrangeTime);

        if(null!=doctorsByArrangeTime){
            return doctorsByArrangeTime;
        }
        return null;

    }
}
